from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Order

@receiver(post_save, sender=Order)
def update_seat_status(sender, instance, **kwargs):
    for seat in instance.seats.all():
        seat.seat_status = '已售'
        seat.save()